package calculate;

import java.util.ArrayList;
import java.util.List;

public abstract class Basic {

	static int preciseDigit;
	static Integer[] hex;
	
	public Basic() {
	}
	
	public Basic( int k ) {
		this.preciseDigit = k;
		hex = new Integer[k+10];	
		System.out.println("calculate pi to : " + this.preciseDigit);
	}
	
	public String toString() {
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		String s = "";
		for (int j = 0; j <= this.preciseDigit; ++j) {
			//System.out.println("the i is " + this.hex[j]);
			s += Integer.toHexString(this.hex[j]).toUpperCase();
		}
		return s;
	}
	
	public int getFirstDigit( double d ) {
		Double kk = 0.0;
		kk = Math.floor(d);
		return(kk.intValue());
	}
	
	public abstract void calculous();
}
